package principle.singleResponsibility;

/**
 * @author shkstart
 * @create ${year}-${month}-${day}-${time}
 */
public class singleResponsibility1 {
    public static void main(String[] args) {
        vehicle2 vehicle2 = new vehicle2();
        vehicle2.runLoad("公交车");
        vehicle2.runAir("飞机");
        vehicle2.runWater("潜艇");
    }
}
//方案三
//没对原类做大修改
//没有在类的级别上遵守单一职责原则
//在方法上遵守单一职责原则
class vehicle2{
    public void runLoad(String vehicle){
        System.out.println(vehicle+"在公路上运行");
    }
    public void runAir(String vehicle){
        System.out.println(vehicle+"在天空上运行");
    }
    public void runWater(String vehicle){
        System.out.println(vehicle+"在水中上运行");
    }
}
